package com.afar.yiyuantong.ui.fragment.first;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.widget.SwipeRefreshLayout;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.afar.yiyuantong.R;
import com.afar.yiyuantong.event.TabSelectedEvent;
import com.afar.yiyuantong.ui.base.BaseMainFragment;
import com.afar.yiyuantong.ui.fragment.MainFragment;

import org.greenrobot.eventbus.Subscribe;

import me.yokeyword.eventbusactivityscope.EventBusActivityScope;

/**
 * Created by wynn on 2018/4/9.
 */

public class WishFragment extends BaseMainFragment {
    private Toolbar mToolbar;
    private SwipeRefreshLayout mRefreshLayout;

    private boolean mInAtTop = true;
    private int mScrollTotal;

    public static WishFragment newInstance() {

        Bundle args = new Bundle();

        WishFragment fragment = new WishFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View view = inflater.inflate(R.layout.fragment_wish, container, false);
        initView(view);
        return view;
    }

    private void initView(View view) {
        mToolbar = (Toolbar) view.findViewById(R.id.toolbar);

        EventBusActivityScope.getDefault(_mActivity).register(this);

        mToolbar.setTitle(R.string.home);
    }

    @Override
    public void onLazyInitView(@Nullable Bundle savedInstanceState) {
        super.onLazyInitView(savedInstanceState);

    }


    /**
     * Reselected Tab
     */
    @Subscribe
    public void onTabSelectedEvent(TabSelectedEvent event) {
        if (event.position != MainFragment.FIRST) return;


    }


    @Override
    public void onDestroyView() {
        super.onDestroyView();
        EventBusActivityScope.getDefault(_mActivity).unregister(this);
    }


}
